<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Správa uživatelů</title>
</head>
<body>

<h1>Správa uživatelů</h1>
<h2>Seznam uživatelů</h2>

<table>
    <tr>
    	<th>Id</th>
        <th>Email</th>
        <th>Admin</th>
        <th>Možnosti</th>  
    </tr>
    
    <c:if test="${users != null}">
        <c:forEach items="${users}" var="u">
            <tr>
            	<td><c:out value="${u.id}" /></td>
                <td><c:out value="${u.email}" /></td>
                <td><c:out value="${u.role}" /></td> 
                	<c:url var="deleteurl" value="delete.html">
					<c:param name="id" value="${u.id}"/>					
					</c:url>
                <td><a href="<c:out value="${deleteurl}"/>">Smazat</a></td>
            </tr>
        </c:forEach>
    </c:if>
</table>
<p>
    <a href="<c:url value="login.html" />">Zpět</a>
</p>


</body>
</html>